#include <iostream>
#include <set>
#include <string>

int main() {
    using str = std::string;
    std::set<str> set;

    while (true) {
        str s;
        std::cin >> s;
        if (s == "0") { break; }
        if (set.find(s) == set.end()) {
            std::cout << s;
            set.insert(s);
        }
    }
}
